A view is a list of columns or a series of
records retrieved from one or more existing tables, or as a combination of one
or more views and one or more tables. Based on this, before creating a view,
you must first decide where its columns and records would come from. Obviously
the easiest view is one whose columns and records come from one table.
Syntax for creating View
CREATE VIEW ViewName
AS
SELECT Statement
Example
CREATE VIEW view1
AS
SELECT * FROM Doctors
Opening or executing View
To open or execute View we use same statement as we use to use for viewing Table
records.
Example
SELECT * FROM view1

Syntax for Modifying View
ALTER VIEW ViewName
AS
SELECT Statement
Example
ALTER VIEW view1
AS
SELECT * FROM Doctors WHERE ID>3

Syntax for Deleting View
DROP VIEW ViewName
Example
DROP VIEW view1
Leave Comment
2 Comments